package android.slc.icr.core.entity;

import java.io.Serializable;
import java.util.Objects;

public class IcrChartRoom implements Serializable {
    private String roomId;
    private String roomName;
    private String createUserId;
    private String roomType;

    public IcrChartRoom() {
    }

    public IcrChartRoom(String roomId, String roomName, String createUserId, String roomType) {
        this.roomId = roomId;
        this.roomName = roomName;
        this.createUserId = createUserId;
        this.roomType = roomType;
    }

    public String getRoomId() {
        return roomId;
    }

    public void setRoomId(String roomId) {
        this.roomId = roomId;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getRoomType() {
        return roomType;
    }

    public void setRoomType(String roomType) {
        this.roomType = roomType;
    }

    public boolean selfTest() {
        return roomId != null && !roomId.isEmpty() &&
                roomName != null && !roomName.isEmpty() &&
                createUserId != null && !createUserId.isEmpty() &&
                roomType != null && !roomType.isEmpty();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        IcrChartRoom that = (IcrChartRoom) o;
        return Objects.equals(roomId, that.roomId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(roomId);
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private String roomId;
        private String roomName;
        private String createUserId;
        private String roomType;

        public Builder setRoomId(String roomId) {
            this.roomId = roomId;
            return this;
        }

        public Builder setRoomName(String roomName) {
            this.roomName = roomName;
            return this;
        }

        public Builder setCreateUserId(String createUserId) {
            this.createUserId = createUserId;
            return this;
        }

        public Builder setRoomType(String roomType) {
            this.roomType = roomType;
            return this;
        }

        public IcrChartRoom build() {
            return new IcrChartRoom(roomId, roomName, createUserId, roomType);
        }
    }
}
